/**
 * string() 值必须是字符串
 * alphanum() 值只能是包含 a-zA-Z0-9 的字符串
 * min(length) 最小长度
 * max(length) 最大长度
 * required() 值是必填项，不能为 undefined
 * pattern(正则表达式) 值必须符合正则表达式的规则
 */

const joi = require('joi')

// 用户名和密码的校验规则
const idList = joi.array().required();
const title = joi.string().required();
const text = joi.string().allow(null, '');
const img_url = joi.string().allow(null, '');
const author = joi.string().required();
const id = joi.string().required();


exports.activity_delete = {
    body:{
        id: idList
    }
}

exports.activity_insert = {
    body: {
        title,
        text,
        img_url,
        author
    }
}

exports.activity_update = {
    body: {
        title,
        text,
        img_url,
        author,
        id
    }
}
